# @Time    :2025/4/4 18:54
from annotated_types.test_cases import cases


def gen():
    task_id = 0
    int_value = 0
    char_value = "A"
    while True:
        match task_id:
            case 0:
                # 生成数字序列
                task_id = yield int_value
                int_value += 1

            case 1:
                # 生成字符序列
                task_id = yield char_value
                char_value = chr(ord(char_value) + 1)
            case _:
                task_id = yield


g = gen()
#print(next(g))
#print(g.send(1))
# print(g.send(0))
# print(g.send(1))
# print(g.send(0))
# print(g.send(0))
# print(g.send(1))

#没有调用next时 要send 就要传入None,唤醒生成器
print(g.send(None))
print(g.send(0))

